﻿using ApiService.EF.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ApiService.EF.Mapper
{
    public class UserEntityMapper : IEntityTypeConfiguration<UserEntity>
    {
        public void Configure(EntityTypeBuilder<UserEntity> builder)
        {
            builder.ToTable("t_base_user");
            builder.HasKey(x => x.Id).HasName("id");
            builder.Property(x => x.UserName).HasColumnName("user_name").IsRequired();
            builder.Property(x => x.RealName).HasColumnName("real_name").IsRequired();
            builder.Property(x => x.Password).HasColumnName("password").IsRequired();
        }
    }
}
